//
//  CPlayerControl.h
//  Monster_Martial_Arts_Version_0
//
//  Created by chiawei.tseng on 13/1/7.
//
//

#ifndef Monster_Martial_Arts_Version_0_CPlayerControl_h
#define Monster_Martial_Arts_Version_0_CPlayerControl_h

#include "IBaseControl.h"
#include "IInputListen.h"
#include "CBattleObject.h"
#include "IEventListener.h"
#include "GameState.h"

class CPlayerControl : public IBaseControl , public IInputListen , public IEventListener
{
public:
    
    
    
    CPlayerControl();
    
    virtual  ~CPlayerControl();
    
    void           Init();
    
    virtual  void  Update();
    
    virtual  void  HandleInput(INPUT_DATA*);
    
    virtual  void  HandleEvent(const CEventSystem::sBaseEvent eventToHandle){}
    
protected:
    
    void onProcessTouchInput(INPUT_DATA* inputData);
    
    virtual void AutoUnRegister(){}
    
private:
    
    BATTLE_TEAM_NUMBER m_TeamNymber;
    
    CBattleObject* m_LockObject;
};

class CBaseCommand : public IStateInput
{
public:
    
    CBaseCommand()
    {
        m_State = BATTLE_OBJECT_STATE_NONE;
    }
    
    virtual ~CBaseCommand(){}
    
    enum Command_Class_Type
    {
        CCT_BaseCommand,
        CCT_Move,
        CCT_Attack,
    };
    
    virtual Command_Class_Type GetCommandClassType()
    {
        return CCT_BaseCommand;
    }
    
    int m_State;

    
};


class CMoveCommand : public CBaseCommand
{
public:
    
    CMoveCommand()
    {
        m_State = BATTLE_OBJECT_STATE_MOVE;
    }
    
    virtual ~CMoveCommand(){}
    
    virtual Command_Class_Type GetCommandClassType()
    {
        return CCT_Move;
    }
    
    fPoint m_target;
};

class CAttackCommand : public CBaseCommand
{
public:
    
    CAttackCommand()
    {
        m_State = BATTLE_OBJECT_STATE_ATTACK;
    }
    
    virtual ~CAttackCommand() {}
    
    virtual Command_Class_Type GetCommandClassType()
    {
        return CCT_Attack;
    }
    
    CBattleObject*  targetObj;
};

#endif
